"""
  模块描述：彩信功能示例demo
  @author 8526
  @date 2022-05-13 11:04:13
  版权所有 Copyright www.dahantc.com
"""

import mms.mmsapi as api
import mms.param as param

client = api.MmsClient(None)


# 彩信报告查询调用
def queryReportDemo():
    head = param.MmsHead('002', 'ac', 'pwd')
    params = param.MmsReportParam(head)
    print('彩信报告查询响应', client.queryReport(params).__dict__)


# 彩信发送方法调用
def mmsSendDemo():
    head = param.MmsHead('002', 'ac', 'pwd')
    submitmsg = param.SubmitMsg('phone', 'title', 'content', 'msgid', 'subcode')
    sendparam = param.MmsSendParam(head, param.MmsSendBody([submitmsg]))
    print('彩信发送响应', client.mmsSend(sendparam).__dict__)


if __name__ == '__main__':
    queryReportDemo()
    print('---------------------')
    mmsSendDemo()
